package cn.z2huo.demo.hello.core.message.api;

import cn.z2huo.demo.hello.core.message.model.ResponseMessage;

/**
 * <p>
 *
 * @author z2huo
 */
public interface ResponseMessageFactory {

    /**
     * 各个异常信息的分隔符
     */
    String RESPONSE_MESSAGE_SPLIT_FLAG = "^^";

    /**
     * 构建“处理成功”的{@link ResponseMessage}.
     *
     * @return {@link ResponseMessage}
     * @author maeagle
     * @since 3.1.0
     */
    ResponseMessage getSuccessMessage();

    /**
     * 构建“处理成功”的{@link ResponseMessage}.
     *
     * @param data 业务数据
     * @return {@link ResponseMessage}
     * @author maeagle
     * @since 3.1.0
     */
    ResponseMessage getSuccessMessage(Object data);

    /**
     * 构建“处理成功”的{@link ResponseMessage}.
     *
     * @param content 消息内容
     * @return {@link ResponseMessage}
     * @author maeagle
     * @since 3.1.0
     */
    ResponseMessage getSuccessMessage(String content);

    /**
     * 构建“处理失败”的{@link ResponseMessage}.
     *
     * @param exceptionInfo 异常对象
     * @return {@link ResponseMessage}
     * @author maeagle
     * @since 3.1.0
     */
    ResponseMessage getFaildMessage(Throwable exceptionInfo);

    /**
     * 构建“处理失败”的{@link ResponseMessage}.
     *
     * @param exceptionInfo 异常对象
     * @param content       消息内容
     * @return {@link ResponseMessage}
     * @author maeagle
     * @since 3.1.0
     */
    ResponseMessage getFaildMessage(Throwable exceptionInfo, String content);

}
